<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    



    <script>
        let arr = []

        for (let i = 0; i <= 99; i++){
            arr.push(i)
        }

        length = 9
        [1,2,3,4,5,6,7,8,9]
    //   0 1 2 3 4 5 6 7 8 

// arr[3] === 4

// arr.splice(3, 1)

// arr[3] === 5


        console.log(arr)

        let result = []
        let itemTotal = 100

        for (let j = 0; j < 10; j ++){
            let index = Math.floor(Math.random() * itemTotal)

            result.push(arr.splice(index, 1)[0])

            itemTotal = itemTotal - 1
            // console.log(arr[Math.floor(Math.random() * 100)])
        }

        console.log(result)

    </script>
</body>
</html>